<script setup lang="ts">
// ref
// js写法

import { ref } from 'vue';

// const count = ref(0)
// ts 写法
// const count = ref<number>(0)
// 简单类型的数据推荐大家省略泛型
const count = ref('a')
// 复杂类型

type ToDoitem = {
  id: number
  name: string
  done: boolean
}
const list = ref<ToDoitem[]>([])

setTimeout(() => {
  list.value = [
    {id: 1, name: '张三', done: true},
    {id: 2, name: '李四', done: false},
  ]
},3000)

</script>

<template>
  <div class="app-page">
    <div>app</div>
    <ul>
      <li v-for="item in list" :key="item.id">{{item.name}}</li>
    </ul>
  </div>
</template>

<style lang="scss" scoped></style>
